﻿using AppFramework;
using AppFramework.DinosaursParkMes.UniqueIdCode;
using AppFramework.Shared;
using Models.DinosaursParkMes.UniqueIdCode;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ViewModels.DinosaursParkMes.UniqueIdCode
{
    public class UniqueIdCodelShowViewModel: NavigationCurdViewModel
    {
        private readonly IUniqueIdCodeAppService uniqueIdCodeAppService;



        public UniqueIdCodelShowViewModel(IUniqueIdCodeAppService uniqueIdCodeAppService)
        {
            this.uniqueIdCodeAppService = uniqueIdCodeAppService;

        }

        /// <summary>
        /// 赋码列表
        /// </summary>
        /// <returns></returns>
        private async Task GetUniqueIdCode()
        {
            await SetBusyAsync(async () =>
            {
                await uniqueIdCodeAppService.GetUniqueIdCode().WebAsync(dataPager.SetList);
            });
        }

        public override async Task OnNavigatedToAsync(NavigationContext navigationContext = null)
        {
            await SetBusyAsync(async () =>
            {
                await GetUniqueIdCode();
            });
        }
    }
}
